package com.kingyea.mobilepolice.apimanage.utils;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author Mr.Lin
 * @version v1.0.0
 * @description
 * @date Created in 2018/4/18 0:32
 */
@FeignClient(value = "auth-server")
public interface TokenControllerClient {

    @RequestMapping(value = "/oauth/token", method = RequestMethod.POST)
    ResponseEntity<OAuth2AccessToken> getAccessToken(@RequestParam Map<String, String> parameters) throws HttpRequestMethodNotSupportedException;
}
